package com.lsl.gencode.util;

import com.lsl.easycode.utils.LogUtil;
import org.beetl.core.Configuration;
import org.beetl.core.GroupTemplate;
import org.beetl.core.Template;
import org.beetl.core.misc.BeetlUtil;
import org.beetl.core.resource.ClasspathResourceLoader;
import org.beetl.core.resource.WebAppResourceLoader;
import org.beetl.ext.servlet.ServletGroupTemplate;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.Properties;

/**
 * Created by liusl on 2016/12/28.
 */
public class ViewRender {

    public static void rend(HttpServletRequest request, HttpServletResponse response,String tempate){

        try{
            Configuration configuration=ServletGroupTemplate.instance().getGroupTemplate().getConf();
            configuration.add("/beetl.properties");
            ServletGroupTemplate.instance().render(tempate, request, response);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
